<?php
//if (session_id() == "") session_start();

function count_digit($number) {
  return  strlen((string) $number);
}

function checkSN($sn){
	settype($sn,'integer');
	$query = sprintf('SELECT * FROM members WHERE SN = %s',
			 $sn);
	$res = sendQ($query);
	if(mysql_num_rows($res) == 1){
		while(($row = mysql_fetch_array($res))!=null ){
			return $row['name'];       
		}
	}else{
		return false;
	}
}


function checkArrays($a,$b){
	
	$countA = count($a);
	$countB = count($b);
	
	if($countA > 0 && $countB > 0){
		foreach($a as $aSN){
			foreach($b as $bSN){
				if($bSN == $aSN){
					return true;
				}
			}
		}
	}
	
	return false;
}



?>